package com.soap.desensitize.posterity.number;

import com.soap.desensitize.encry.IDesensitization;
import com.soap.desensitize.exception.strategy.DecodeException;
import com.soap.desensitize.exception.strategy.EncodeException;
import com.soap.desensitize.posterity.AbstractPosterity;
import com.soap.desensitize.strategy.rreversible.symmetry.NumStrategy;

public class NumDesensitization extends AbstractPosterity<String> {
    /**
     * 默认使用数字策略加密
     */
    public NumDesensitization(){
        super(NumStrategy.getInstance());
    }
    /**
     * @param encry
     * @desc 有参构造器
     */
    public NumDesensitization(IDesensitization encry) {super(encry);}

    @Override
    public String encode(String data) throws EncodeException {
        return (String)encry.encode(data);
    }

    @Override
    public String decode(String data) throws DecodeException {
        return (String)encry.decode(data);
    }
}
